
import { createRouter, createWebHashHistory } from 'vue-router'

// 引入路由对应的组件
import Films from './views/Films.vue'
import Film from './views/Film.vue'

const router = createRouter({
  history: createWebHashHistory(),

  routes: [
    {
      path: '/',
      redirect: '/films',
    },
    {
      path: '/films',
      component: Films
    },
    {
      path: '/film/:id',
      component: Film
    }
  ]
})

// 最后，导出 路由器实例对象
export default router